package com.jingfu.configuration.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.SessionsSecurityManager;
import org.apache.shiro.spring.config.ShiroAnnotationProcessorConfiguration;
import org.apache.shiro.spring.config.ShiroBeanConfiguration;
import org.apache.shiro.spring.config.ShiroConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.annotation.PostConstruct;

/**
 * 普通的spring应用shiro集成配置
 * @author jingfuu@163.com
 * @version v1.0
 * @date 2022/1/7 上午9:56
 **/
// @Configuration
/*@Import({ShiroBeanConfiguration.class,
        ShiroConfiguration.class,
        ShiroAnnotationProcessorConfiguration.class})*/
public class ShiroConfig {
    //@Autowired
    private SessionsSecurityManager securityManager;

    //@PostConstruct
    private void initStaticSecurityManager() {
        SecurityUtils.setSecurityManager(securityManager);
    }
}
